import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);

const store = new Vuex.Store({
    state:{
        token:"",
        userInfo:null,
        menus:null,
    },

    mutations:{
        //设置token
		setToken(state,token){
			state.token=token;
        },
        //设置用户信息
		setUserInfo(state, userInfo) {
		    state.userInfo = userInfo;
        },	
        //设置后台菜单
        setMenus(state,menus){
            state.menus = menus;
        }
    }
});


export default store